<!DOCTYPE html>
<html lang="zh">

<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://cdn.staticfile.net/vue/2.7.8/vue.js"></script>
    <link href="../css/style.css" rel="stylesheet">
</head>

<body>
<div id="app">
    <h1>事件处理器</h1>
    <input id="textName" v-on:keyup="textKeyUp($event)">

    <button id="btnOk" v-on:click="btnClick($event)">点击</button>
</div>
<script>
    const vm = new Vue({
        el: '#app',
        data: {},
        methods: {
            textKeyUp: function (e) {
                console.log(e)
            },
            btnClick: function (e) {
                console.log(e)
            }
        }
    });
</script>
</body>
</html>